Skip to content

feat(docs): add custom 404 page#2106

Closed
gakonst wants to merge 6 commits intomainfrom
amp/web-89-custom-404-page
Closed

feat(docs): add custom 404 page#2106
gakonst wants to merge 6 commits intomainfrom
amp/web-89-custom-404-page

Conversation

@gakonst
Copy link
Copy Markdown
Contributor

@gakonst gakonst commented Jan 16, 2026

Adds a helpful 404 page for the docs site so invalid URLs like https://docs.tempo.xyz/dfdf show a more helpful page.

Changes

  • Created pages/404.mdx with:
    • Large 404 indicator
    • Friendly message explaining the page wasn't found
    • Quick navigation cards (Docs Home, Get Started, Learn, Search)
  • Updated vercel.json to route unmatched paths to the 404 page

Preview

The page will show a centered 404 with helpful navigation options to get users back on track.

Fixes WEB-89

Adds a helpful 404 page for the docs site with:
- Large 404 indicator
- Friendly message explaining the page wasn't found
- Quick navigation cards to get back on track:
  - Docs Home
  - Get Started guide
  - Learn section
  - Search

Fixes WEB-89
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 16, 2026

Deployment failed with the following error:

If `rewrites`, `redirects`, `headers`, `cleanUrls` or `trailingSlash` are used, then `routes` cannot be present.

Learn More: https://vercel.link/mix-routing-props

Vercel automatically serves 404.html from build output for unmatched routes
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
tempo-docs Error Error Jan 16, 2026 11:48am

Review with Vercel Agent

- Rename pages/404.mdx to pages/*.mdx so Vocs treats it as catch-all route
- Update build script to copy generated 404 to dist/404.html for Vercel
Vocs generates "/*" for *.mdx catch-all routes but checks for "*" in
routes.tsx, causing client-side navigation to show the default NotFound
component instead of the custom 404 page. This adds a Vite plugin to
patch the route matching at build time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename *.mdx to 404.mdx so vocs builds it to dist/404/index.html
- Update build script to copy from dist/404/index.html
- Update vocs plugin to redirect unknown routes to /404 using Navigate

The catch-all *.mdx approach didn't work because vocs doesn't prerender
catch-all routes. This approach uses a regular /404 page that gets built
normally, then copied to 404.html for Vercel, with client-side routing
redirecting to /404.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
  Remove complex imports (icons, Card components) to test if they were
  causing silent prerender failures.

  Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jxom
Copy link
Copy Markdown
Member

jxom commented Jan 20, 2026

Moved to tempoxyz/docs#9

@jxom jxom closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants